package com.joker.userExam.controller.useLoginController;

import com.joker.userExam.model.UserInfo;
import com.joker.userExam.service.IUserLogin;
import com.joker.userExam.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 李杰
 * @date 2021/4/10 - 15:13
 */
@CrossOrigin(origins = "http://localhost:3000")
@RestController
@RequestMapping("/user")
public class UserLogin {

    @Autowired
    private IUserLogin userLogin;


    @PostMapping("/userLogin")
    public ResultUtil login(@RequestBody UserInfo model) {
        return userLogin.login(model);
    }

    @PostMapping("/userInfoUpdate")
    ResultUtil updateUserInfo(@RequestBody UserInfo userInfo) {
        return userLogin.updateUserInfo(userInfo);
    }


}
